<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet"href="https://cdn.staticfile.org/font-awesome/6.0.0/css/all.css">

		<link rel="stylesheet" href="{{ static('css/index.css') }}"/>

		<!-- 新 Bootstrap5 核心 CSS 文件 -->
		<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css">

	</head>
	<body style="height: auto">
       <div class="head">

           <a href="{{ url('mainPage') }}" class="nav-link"><div class="h3">Haoyunlai driving school</div></a>

           <nav class="navbar navbar-expand-sm">

              <!-- Links -->
              <ul class="navbar-nav">
                <li class="nav-item">
                  <a class="nav-link" href="{{ url('index') }}">Home</a>
                </li>
                  {% if user.identity_c == '1' %}
                  {% else %}
                <li class="nav-item">
                  <a class="nav-link" href="{{ url('cindex') }}">Appiontment training</a>
                </li>
                <li class="nav-item">
                  <a class="nav-link" href="{{ url('book_exaln@index') }}">Appiontment examination</a>
                </li>
                  {% endif %}
              </ul>

            </nav>
             <nav class="navbar navbar-expand-sm ">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" type="top" href="mailto:xxx@xxx.com" target="_blank">Contact us</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" type="top" href="{{ url('onst') }}">About us</a>
                    </li>
                    <li class="nav-item">
                        <a href="{{ url('logout') }}" class="btn btn-danger">Logout</a>
                    </li>
                </ul>
            </nav>
       </div>
        <div class="container-xl">
        <h1>Appointment test system</h1>
        <hr>
        <h3>Subject 1</h3>
        <table class="table table-striped">
            <thead>
              <tr>
                <th>Datetime</th>
                <th>People num</th>
                <th>Appointment</th>
              </tr>
            </thead>
            <tbody>

               {% for i in data[0] %}
                    <tr>
                        <td>{{ i.examination_time}}</td>
                        <td>{{ i.number_of_people }}</td>
                        {% if i.examination_time<datenow %}
                            <td><button class="btn-primary btn disabled">Time out</button></td>
                        {% else %}
                            <td><button class="btn-primary btn" id="book" data-id="{{ i.id }}">Appointment</button></td>
                        {% endif %}
                      </tr>
               {% endfor %}
            </tbody>
        </table>
        <hr>
        <h3>Subject 2</h3>
        <table class="table table-striped">
            <thead>
              <tr>
                <th>Datetime</th>
                <th>People num</th>
                <th>Appointment</th>
              </tr>
            </thead>
            <tbody>

               {% for i in data[1] %}
                    <tr>
                        <td>{{ i.examination_time}}</td>
                        <td>{{ i.number_of_people }}</td>
                        {% if i.examination_time<datenow %}
                            <td><button class="btn-primary btn disabled">Time out</button></td>
                        {% else %}
                            <td><button class="btn-primary btn" id="book" data-id="{{ i.id }}">Appointment</button></td>
                        {% endif %}
                      </tr>
               {% endfor %}
            </tbody>
        </table>
        <hr>
        <h3>Subject 3</h3>
        <table class="table table-striped">
            <thead>
              <tr>
                <th>Datetime</th>
                <th>People num</th>
                <th>Appointment</th>
              </tr>
            </thead>
            <tbody>

               {% for i in data[2] %}
                    <tr>
                        <td>{{ i.examination_time}}</td>
                        <td>{{ i.number_of_people }}</td>
                        {% if i.examination_time<datenow %}
                            <td><button class="btn-primary btn disabled">time out</button></td>
                        {% else %}
                            <td><button class="btn-primary btn" id="book" data-id="{{ i.id }}">Appointment</button></td>
                        {% endif %}
                      </tr>
               {% endfor %}
            </tbody>
        </table>
        <hr>
        <h3>Subject 4</h3>
        <table class="table table-striped">
            <thead>
              <tr>
                <th>Datetime</th>
                <th>People num</th>
                <th>Appointment</th>
              </tr>
            </thead>
            <tbody>

               {% for i in data[3] %}
                    <tr>
                        <td>{{ i.examination_time}}</td>
                        <td>{{ i.number_of_people }}</td>
                        {% if i.examination_time<datenow %}
                            <td><button class="btn-primary btn disabled">Time out</button></td>
                        {% else %}
                            <td><button class="btn-primary btn" id="book" data-id="{{ i.id }}">Appointment</button></td>
                        {% endif %}
                      </tr>
               {% endfor %}
            </tbody>
        </table>
        </div>
	</body>

	<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
	<!--  popper.min.js 用于弹窗、提示、下拉菜单 -->
	<script src="https://cdn.staticfile.org/popper.js/2.9.3/umd/popper.min.js"></script>
	<!-- 最新的 Bootstrap5 核心 JavaScript 文件 -->
	<script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.min.js"></script>
	<script src="{{ static('js/index.js') }}"></script>
    <script>init_book('{{ csrf_token }}')</script>
</html>
